import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/404',
      name: '404',
      component: () => import('@/views/404/404.vue'),
      meta: {
        // 在左侧菜单不显示该路由
        hidden: true
      }
    },
    {
      path: '/',
      name: 'Home',
      component: () => import('@/views/home/home.vue'),
      meta: {
        // 在左侧菜单不显示该路由
        hidden: true
      }
    },
    {
      path: '/category',
      name: 'Category',
      component: () => import('@/views/category/category.vue'),
      meta: {
        // 在左侧菜单不显示该路由
        title:'分类'
      }
    },
    {
      path: '/desire',
      name: 'Desire',
      component: () => import('@/views/desireBuy/desireBuy.vue'),
      meta: {
        // 在左侧菜单不显示该路由
        title:'值得买'
      }
    },
    {
      path: '/search',
      name: 'Search',
      component: () => import('@/views/search/search.vue'),
      meta: {
        // 在左侧菜单不显示该路由
        title:'搜索'
      }
    },
    {
      path: '/shopcart',
      name: 'ShopCart',
      component: () => import('@/views/shopCart/shopCart.vue'),
      meta: {
        // 在左侧菜单不显示该路由
        title:'购物车'
      }
    },
    {
      path: '/user',
      name: 'User',
      component: () => import('@/views/user/user.vue'),
      meta: {
        // 在左侧菜单不显示该路由
        hidden: true
      }
    },
  ],
  scrollBehavior() {
    return { top: 0, left: 0 }
  }
})

export default router
